﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlLietKeNVNhapHang.ascx.cs" Inherits="UserControl_ControlLietKeNVNhapHang" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register src="~/UserControl/ControlReportViewer.ascx" tagname="ReportViewerControl" tagprefix="uc1" %>

<%@ Register Assembly="webapp4U" Namespace="webapp4U.UI" TagPrefix="webapp4U"  %>

<script type="text/javascript">
    function pageLoad() {
        $("#<%= txtFromDate.ClientID %>").datePicker(
	                {
	                    clickInput: true,
	                    startDate: '01/01/1970'
	                });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }
    }
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
          <div class="direct_container_right_titletop">
            Liệt kê nghiệp vụ nhập hàng từ nhà cung cấp
        </div>
         <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" BackColor="#CCFFFF"
            Font-Names="Arial" Width="100%">
        <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Danh sách nghiệp vụ nhập hàng" TabIndex="0">
            <ContentTemplate> 
              <div class="direct_container_main">
                    <table>
                        <tr>
                            <td>Ngày</td>
                            <td>  
                                <asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox> 
                                <asp:RequiredFieldValidator ControlToValidate="txtFromDate" Display="None"  ID="RFVName" runat="server" ErrorMessage="Phải chọn ngày">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RFVName" ID="ValidatorCalloutExtender1" runat="server">
                                </cc1:ValidatorCalloutExtender>                                     
                            </td>
                       
                         <td>
                                <asp:ImageButton ID="imgBtnAdd" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                                
                            </td>
                        </tr>
                    </table>
                     <asp:GridView ID="grdvNghiepVuNhanHangLists" AutoGenerateColumns="False"
                        DataKeyNames="vouchno"  AllowPaging="true" PageSize="10"                            
                        runat="server" Width="100%"
                        onselectedindexchanged="grdvNghiepVuNhanHangLists_SelectedIndexChanged"
                        OnPageIndexChanging="grdvNghiepVuNhanHangLists_PageIndexChanging"
                        ForeColor="#333333" GridLines="None" EnableModelValidation="True">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            
                            <asp:TemplateField HeaderText="Số chứng từ">
                                <HeaderTemplate>Số chứng từ</HeaderTemplate>
                                <ItemTemplate>
                                        <%# Eval("vouchno")%>
                                </ItemTemplate>                                
                                <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Nhà cung cấp">
                                <HeaderTemplate>Nhà cung cấp</HeaderTemplate>
                                <ItemTemplate>
                                        <%# Eval("vendorname")%>
                                </ItemTemplate>                                
                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Ngày">
                                <HeaderTemplate>Ngày</HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblDate" runat="server" Text='<%# Eval("invdate")%>'></asp:Label>                                     
                                </ItemTemplate>                                
                                <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />
                            </asp:TemplateField>

                            
                            <asp:TemplateField HeaderText="Tổng tiền">
                                <HeaderTemplate>Tổng tiền</HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("vouchTotal", "{0:#,#.##}")%>
                                </ItemTemplate>                                                                
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                <ItemStyle Height="40px" HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>

                            <asp:TemplateField
                                HeaderText="Xem và in">
                                <HeaderTemplate>
                                    Xem và In
                                </HeaderTemplate>
                                <ItemTemplate> 
                                    <asp:ImageButton ID="btnDelete" runat="server" CausesValidation="false" CommandName="Select" ImageUrl="~/Images/icon_print.png" ToolTip="Xem và In" ></asp:ImageButton> 
                                </ItemTemplate>               
                                <HeaderStyle Width="70px" />
                                <ItemStyle HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField> 
                            
                    </Columns>
                        <FooterStyle  BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#0066CC" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                    </asp:GridView>
        </div>
        
        </ContentTemplate>
                
            </cc1:TabPanel>
            
            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Chi tiết in" TabIndex="1">
                <ContentTemplate>
                    <uc1:ReportViewerControl ID="ControlReportViewer1" runat="server" />
                    
                </ContentTemplate>
            </cc1:TabPanel>                
        </cc1:TabContainer>
    </ContentTemplate>
</asp:UpdatePanel>